package com.haolianluo.ddz;

import com.haolianluo.ddz.tool.Tools;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Window;
import android.view.WindowManager;

public class DDZ extends Activity {
	public final static int MENU = 0;
	public final static int GAME = 1;
	public final static int RESULT = 2;
	public static  DDZ ddz;

	public GameView gv;
	private MenuView mv;
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		ddz=this;
		gv=new GameView(this,this);
		mv=new MenuView(this,this);
		Tools.getScreenSize(this);
		setContentView(mv);
	}
	
	public Handler handler = new Handler(){
		public void handleMessage(Message msg) {
			switch(msg.what){
			case MENU:
				setContentView(mv);
				break;
			case GAME:
				setContentView(gv);
				break;
			case RESULT:
				break;
			}
		};
	};
	
}